// https://facebook.github.io/create-react-app/docs/proxying-api-requests-in-development#configuring-the-proxy-manually
// https://github.com/chimurai/http-proxy-middleware

const { createProxyMiddleware } = require('http-proxy-middleware');

module.exports = function(app) {
    app.use(
        createProxyMiddleware('/api', {
            target: 'http://10.139.100.111:8088/',
            changeOrigin: true,
            pathRewrite: {
                '^/api': '/'
            }
        })
    );
    // app.use(
    //   proxy('/xxx', {
    //     target: 'http://bbb:2000',
    //     changeOrigin: true,
    //     pathRewrite: {
    //       '^/xxx': ''
    //     }
    //   })
    // );
};
